<?php
include 'conn.php';
if(isset($_POST['name'])||isset($_POST['submit'])){
    $name=@$_POST['name'];
    $result=$conn->query("select * from registry where username='$name'");
    if($result->fetch_assoc()){
        echo true;
    }else{
        echo false;
    }
}
else{
    exit('非法操作');
}

if(isset($_POST['submit'])){
    $user=$_POST['username'];
    $pass=sha1($_POST['password']);
    $conn->query("insert registry values(null,'$user','$pass',NOW())");
    header('location:http://10.31.155.19//MallProject/src/login.html');
}